Automatic generation of certified construction functions guaranteeing algebraic invariants on concrete data types

نویسندگان

  • Frédéric Blanqui
  • Pierre Weis
چکیده

Concrete data types and pattern-matching are salient features of modern programming languages as powerful ways of defining and manipulating data structures. Among other things (eg. abstract syntax trees, regular expressions, DNA sequences, chemistry, cellular automata), the developments of XML greatly increases the interest in more complex pattern-matching for easily writing programs transforming or querying XML documents. Various functional programming languages are extended with XML specific data types and matching (eg. OcamlDuce). Even some well-known non-functional programming languages (eg. C, Java) are extended with such complex pattern-matching (eg. TOM). Although concrete date types are very useful in defining complex data structures, they are not always sufficient to adequately specify the data structures manipulated by the algorithms. Often, only a subset of the concrete data type is in fact used since some invariants between the components are mandatory to ensure the correctness of the program. For instance, some list have to be sorted and should never have the same element twice. The usual way to solve this problem is to use abstract data types: no constructor is declared but instead construction functions that are supposed to guarantee the invariants are used to build the values of the data structure. However, by using an abstract data type, the programmer loses the ability to do pattern-matching, although this would not harm. Indeed, to maintain the invariants, the only important thing is to make sure that the user can only build values by using the construction functions. Pierre Weis’s ”private” data types in OCaml solves this problem [4]. Now, many data structures use common algebraic properties as invariants. For instance, a sorted list is a particular representant of the equivalence class of lists modulo commutativity. A list without the same element twice is a particular representant of the equivalence class of lists modulo idempotence. And, as soon as various such algebraic invariants must be combined, it becomes very difficult to write correct and efficient construction functions. That is why we propose to study the automatic generation of certified construction functions guaranteeing algebraic invariants on concrete data types. Together with Thérèse Hardin (LIP6, Paris), we already have preliminary

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

On the Implementation of Construction Functions for Non-free Concrete Data Types

Many algorithms use concrete data types with some additional invariants. The set of values satisfying the invariants is often a set of representatives for the equivalence classes of some equational theory. For instance, a sorted list is a particular representative wrt commutativity. Theories like associativity, neutral element, idempotence, etc. are also very common. Now, when one wants to comb...

متن کامل

Polytypic Functional Programming

Structural polymorphism is a generic programming technique known within the functional programming community under the names of polytypic or datatype-generic programming. In this thesis we show that such a technique conflicts with the principle of data abstraction and propose a solution for reconciliation. More concretely, we show that popular polytypic extensions of the functional programming ...

متن کامل

Rational, Replacement, and Local Invariants of a Group Action

The paper presents a new algorithmic construction of a finite generating set of rational invariants for the rational action of an algebraic group on the affine space. The construction provides an algebraic counterpart of the moving frame method in differential geometry. The generating set of rational invariants appears as the coefficients of a Gröbner basis, reduction with respect to which allo...

متن کامل

Numeric Invariants from Multidimensional Persistence

We extend the results of Adcock, Carlsson, and Carlsson ([ACC13]) by constructing numeric invariants from the computation of a multidimensional persistence module as given by Carlsson, Singh, and Zomorodian in [CSZ10]. The use of topology to study point cloud data has been well established ([Car09], [Car14]). Given a finite metric space (e.g., a finite set in R n), one first constructs a filter...

متن کامل

A Data Driven Approach for Algebraic Loop Invariants

We describe a Guess-and-Check algorithm for computing algebraic equation invariants of the form ∧ifi(x1, . . . , xn) = 0, where each fi is a polynomial over the variables x1, . . . , xn of the program. The “guess” phase is data driven and derives a candidate invariant from data generated from concrete executions of the program. This candidate invariant is subsequently validated in a “check” pha...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007